import request from '@/utils/request'
// import qs from 'qs'
// 获取课程列表
export const getCourseList = data => {
  return request({
    method: 'POST',
    url: '/boss/course/getQueryCourses',
    data
  })
}
// 改变课程上下架状态
export const changeCourseState = params => {
  return request({
    method: 'GET',
    url: '/boss/course/changeState',
    params
  })
}
// 通过课程Id获取课程信息
export const getCourseById = params => {
  return request({
    method: 'GET',
    url: '/boss/course/getCourseById',
    params
  })
}
// 通过课程Id获取课程章节和课时
export const getSectionAndLesson = params => {
  return request({
    method: 'GET',
    url: '/boss/course/section/getSectionAndLesson',
    params
  })
}
// 保存或者更新课程信息
export const saveOrUpdateCourse = data => {
  return request({
    method: 'POST',
    url: '/boss/course/saveOrUpdateCourse',
    data
  })
}

// 上传图片
export const uploadImg = (data, onUploadProgress) => {
  return request({
    method: 'POST',
    url: '/boss/course/upload',
    data,
    onUploadProgress
  })
}
